; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-- -mattr=+prefetchi | FileCheck %s

define dso_local void @t(ptr %ptr) nounwind  {
; CHECK-LABEL: t:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    prefetchit1 (%rdi)
; CHECK-NEXT:    prefetchit0 (%rdi)
; CHECK-NEXT:    prefetchit1 t(%rip)
; CHECK-NEXT:    prefetchit0 ext(%rip)
; CHECK-NEXT:    retq
entry:
  tail call void @llvm.prefetch(ptr %ptr, i32 0, i32 2, i32 0)
  tail call void @llvm.prefetch(ptr %ptr, i32 0, i32 3, i32 0)
  tail call void @llvm.prefetch(ptr @t,   i32 0, i32 2, i32 0)
  tail call void @llvm.prefetch(ptr @ext, i32 0, i32 3, i32 0)
  ret void
}

declare dso_local void @ext() nounwind
declare void @llvm.prefetch(ptr, i32, i32, i32) nounwind
